<template>
    <h3>ComponentB</h3>
    <p>{{ message }}</p>
    <button @click="updateHandle">更新数据</button>
</template>

<script>
export default {
    data() {
        return {
            message: "B组件老数据"
        }
    },
    methods: {
        updateHandle() {
            this.message = "B组件新数据"
        }
    },
    beforeUnmount() {
        console.log("B组件销毁之前");
    },
    unmounted() {
        console.log("B组件销毁之后");
    }
}
</script>

